class WxPayModel {
  Order? order;
  Wechatpayinfo? wechatpayinfo;

  WxPayModel({order, wechatpayinfo});

  WxPayModel.fromJson(Map<String, dynamic> json) {
    order = json['order'] != null ? Order.fromJson(json['order']) : null;
    wechatpayinfo = json['wechatpayinfo'] != null
        ? Wechatpayinfo.fromJson(json['wechatpayinfo'])
        : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    if (order != null) {
      data['order'] = order!.toJson();
    }
    if (wechatpayinfo != null) {
      data['wechatpayinfo'] = wechatpayinfo!.toJson();
    }
    return data;
  }
}

class Order {
  int? type;
  int? userGender;
  String? orderNo;
  int? channelId;
  int? channelType;
  String? channelName;
  int? goodsId;
  String? goodsName;
  double? goodsPrice;
  int? expireTime;

  Order(
      {type,
      userGender,
      orderNo,
      channelId,
      channelType,
      channelName,
      goodsId,
      goodsName,
      goodsPrice,
      expireTime});

  Order.fromJson(Map<String, dynamic> json) {
    type = json['type'];
    userGender = json['user_gender'];
    orderNo = json['order_no'];
    channelId = json['channel_id'];
    channelType = json['channel_type'];
    channelName = json['channel_name'];
    goodsId = json['goods_id'];
    goodsName = json['goods_name'];
    goodsPrice = double.parse(json['goods_price'].toString());
    expireTime = json['expire_time'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['type'] = type;
    data['user_gender'] = userGender;
    data['order_no'] = orderNo;
    data['channel_id'] = channelId;
    data['channel_type'] = channelType;
    data['channel_name'] = channelName;
    data['goods_id'] = goodsId;
    data['goods_name'] = goodsName;
    data['goods_price'] = goodsPrice;
    data['expire_time'] = expireTime;
    return data;
  }
}

class Wechatpayinfo {
  String? appid;
  String? partnerid;
  String? prepayid;
  String? package;
  String? noncestr;
  int? timestamp;
  String? sign;

  Wechatpayinfo(
      {appid, partnerid, prepayid, package, noncestr, timestamp, sign});

  Wechatpayinfo.fromJson(Map<String, dynamic> json) {
    appid = json['appid'];
    partnerid = json['partnerid'];
    prepayid = json['prepayid'];
    package = json['package'];
    noncestr = json['noncestr'];
    timestamp = json['timestamp'];
    sign = json['sign'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['appid'] = appid;
    data['partnerid'] = partnerid;
    data['prepayid'] = prepayid;
    data['package'] = package;
    data['noncestr'] = noncestr;
    data['timestamp'] = timestamp;
    data['sign'] = sign;
    return data;
  }
}
